package org.example.springioc.yml;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("yml")
@RestController
public class readKey {

    @Autowired
    private Student student;

    @RequestMapping("readStudent")
    public String read2(){
        return "student:"+student;
    }


    @Autowired
    private Dbtype dbtype;

    @RequestMapping("readDbtypes")
    public String read3(){
        return "Dbtypes:"+dbtype;
    }

    @Value("${myKey.key1}")
    private String key;

    @Value("${server.port}")
    private Integer port;

    @RequestMapping("readKey")
    public String read(){
        return "key:"+key;
    }

    @RequestMapping("readPort")
    public String read1(){
        return "Port:"+port;
    }







}
